#ifndef _NE_FRUSTUM_H_
#define _NE_FRUSTUM_H_

#include <mathematics/Plane.h>
#include <mathematics/AABB.h>
#include <mathematics/Sphere.h>

namespace ne
{
    enum FrustumPlane
    {
        FRUSTUM_PLANE_NEAR,
        FRUSTUM_PLANE_FAR,
        FRUSTUM_PLANE_LEFT,
        FRUSTUM_PLANE_RIGHT,
        FRUSTUM_PLANE_TOP,
        FRUSTUM_PLANE_BOTTON
    };

    class NEAPI Frustum
    {
        public:
            Frustum();

            Frustum(const Frustum &f);

            void setPlane(const Plane &p, const FrustumPlane fp) const;

            Plane* getPlane(const FrustumPlane fp) const;

            bool intersects(const AABB &a) const;

            bool intersects(const Sphere &s) const;

            bool intersects(const Vector3 &point) const;

            Frustum& operator = (const Frustum &f);

            inline ~Frustum() {}

        private:
            mutable Plane mPlanes[6];
    };
}

#endif
